
<html>
  <head>
    <title>SPL - Resultados da Consulta</title>
    <g:if test="${tipoUsuario == 'Admin'}">
        	<meta name="layout" content="adminBiblioteca" />
        </g:if>
        <g:else>
        	<meta name="layout" content="usuarioBiblioteca" />
        </g:else>
  </head>
  <body>
    <h1>Resultado da Consulta</h1>
    <div class="list">
      <table>
        <thead>
          <tr>

        <g:sortableColumn property="titulo" title="${message(code: 'emprestimo.titulo.label', default: 'Titulo')}" params ="${params}"/>

        <g:sortableColumn property="tipo" title="${message(code: 'emprestimo.tipo.label', default: 'Tipo')}" params ="${params}"/>
        
        <g:sortableColumn property="login" title="${message(code: 'emprestimo.login.label', default: 'Login')}" params ="${params}"/>

        <g:sortableColumn property="dataEmprestimo" title="${message(code: 'emprestimo.dataEmprestimo.label', default: 'Data de Emprestimo')}" params ="${params}"/>
        
        <g:sortableColumn property="dataDevolucao" title="${message(code: 'emprestimo.dataDevolucao.label', default: 'Data de Devolucao')}" params ="${params}"/>
        
        <g:sortableColumn property="idItem" title="Detalhes" />

        </tr>
        </thead>
        <tbody>
        <g:each in="${pesquisaEmprestimo}" status="i" var="emprestimoInstance">
          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

            <td>${fieldValue(bean: emprestimoInstance, field: "titulo")}</td>

            <td>${fieldValue(bean: emprestimoInstance, field: "tipo")}</td>
            
            <td>${fieldValue(bean: emprestimoInstance, field: "login")}</td>

            <td>${fieldValue(bean: emprestimoInstance, field: "dataEmprestimo")}</td>
            
            <td>${fieldValue(bean: emprestimoInstance, field: "dataDevolucao")}</td>
            
            <td><g:link action="show" id="${emprestimoInstance.idItem}">
                              Ver mais</g:link></td>

        </tr>
        </g:each>
        </tbody>
      </table>
    </div>

            <div class="paginateButtons">
        <g:paginate total="${pesquisaEmprestimo.count()}" />
        </div>

        <g:jasperReport action="createReportEmprestimoComplete" controller="emprestimo" format="PDF" jasper="Relatorio SPL - Emprestimo Completo" name="Relatorio SPL - PDF"/>
        <g:jasperReport action="createReportEmprestimoComplete" controller="emprestimo" format="XLS" jasper="Relatorio SPL - Emprestimo Completo" name="Relatorio SPL - XLS"/>
        <g:jasperReport action="createReportEmprestimoComplete" controller="emprestimo" format="ODT" jasper="Relatorio SPL - Emprestimo Completo" name="Relatorio SPL - ODT"/>
        <g:jasperReport action="createReportEmprestimoComplete" controller="emprestimo" format="DOCX" jasper="Relatorio SPL - Emprestimo Completo" name="Relatorio SPL - DOCX"/>

  <div align="center"><br></br><g:link action='search'>Pesquisar Novamente</g:link></div>
</body>
</html>